<!--COLUMN 1-->
<div class="ThreeColGrid_c1">
<div id="output" class="myAvatar">
          <?php 
            if($this->data['Locum']['Avatar'])
            {
                echo '<img src="'. Router::url('/').'app/webroot/img/avatar/'.$this->data['Locum']['Avatar'].'" width="100" alt="Locum">';
            }else
            {
                echo '<img src="'.Router::url('/').'app/webroot/img/avatar.jpg" width="100" alt="Locum">';
            }
          ?>
</div>

<a href="javascript:void(0)" id='UploadImage' class="TitleFive">edit image</a>
 
<div class="hide" id="upload-block">
<?php echo $form->create('Locum', array('action'=>'upload_avatar','id'=>'FileUploader','type'=>'post','enctype' => 'multipart/form-data'));?>
<?php echo $form->input('mFile',array('label'=>'','div'=>'','type'=>'file','size'=>2)); ?>
<button type="submit" class="red-button" id="uploadButton">Upload</button>
<?php echo $form->end()?>
</div>

</div>
<!--COLUMN 1-->

<!--COLUMN 2-->
<div class="ThreeColGrid_c2">
<?php $session->flash(); ?> 
<h4 class="TitleTwo">Edit your profile</h4>
<p><b>Please note:</b> The more detail you give the more likely you are to successfully find work.</br>Your data is kept private at all times and will never be sold to a third party.</p> 
<p>&nbsp;</p> 
<p>&nbsp;</p> 
<?php echo $form->create('Locum',array('action' => 'edit'));?>    
<?php echo $form->input('id',array('label'=>'','div'=>'','type'=>'hidden')); ?>
<?php echo $form->input('Avatar',array('label'=>'','div'=>'','type'=>'hidden')); ?>

<table border="0" cellspacing="0" cellpadding="0">

<tr>
<td valign="top" width="200"><span class="frmLabel">Username</span></td>
<td valign="top" width="200"><?php echo $this->data['Locum']['Username'] ?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Salutation</span></td>
<td><?php echo $form->select('Salutation',$GLOBALS['Salutations'],null,array('label'=>'','div'=>''),false); ?></td>          
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">First name</span></td>
<td><?php echo $form->input('FirstName',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Last name</span></td>
<td><?php echo $form->input('LastName',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Address</span></td>
<td><?php echo $form->input('Address', array('type' => 'textarea','label'=>false, 'escape' => false,'rows'=>5,'cols'=>30));?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">County</span></td>
<td>
<select name="data[Locum][Country_id]" id="UserCountry">
<?php
                                  $temp ='';
                                  foreach ($GLOBALS['Counties'] as $group=>$countries)
                                  {
                                       if($group != $temp)
                                       {
                                            echo  '<optgroup label="'.$group.'">'  ;
                                       }
                                       foreach ($countries as $k=>$country) 
                                       {
                                                if($this->data['Locum'][Country_id] == $k)
                                                    echo  ' <option value="'.$k.'" selected="selected">'.$country.'</option>'   ;
                                                else
                                                    echo  ' <option value="'.$k.'">'.$country.'</option>'  ;
                                       }
                                       
                                       $temp = $group;
                                  }
    
                            
?>
</select>
</td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Postcode</span></td>
<td><?php echo $form->input('Postcode',array('label'=>'','div'=>'')); ?>
<span class="noteTwo">Postcode + space + street (Ex: CW12 2AT)</span> 
</td>
</tr>

<tr>

<td valign="top" width="200"><span class="frmLabel">Email</span></td>
<td><?php echo $form->input('Email',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Telephone</span></td>
<td><?php echo $form->input('Telephone',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Fax</span></td>
<td><?php echo $form->input('Fax',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" style="display: block; margin:0 0 10px 0;"><span class="frmLabel">Match member since</span></td>
<td>Date: <?php 
                        if(empty($this->data['Locum']['MatchMemberSince']))
                            $this->data['Locum']['MatchMemberSince'] = $userInfo['User']['MatchMemberSince'];
                            
                        echo date('y-m-d',strtotime($this->data['Locum']['MatchMemberSince']))
                
?>
</td>
</tr>

<tr>
<td valign="top" style="display: block; margin:0 0 10px 0;"><span class="frmLabel">Last logged in</span></td>
<td>Date: 
<?php 
if(empty($this->data['Locum']['LastLoggedIn']))
$this->data['Locum']['LastLoggedIn'] = $userInfo['User']['LastLoggedIn'];
echo date('y-m-d',strtotime($this->data['Locum']['LastLoggedIn']))               
?>
</td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">GPHC Number</span></td>
<td><?php echo $form->input('GPHCNumber',array('label'=>'','div'=>'')); ?></td>
</tr>

 <tr>
<td valign="top" width="200"><span class="frmLabel">Pharmacist reg date</span></td>
<td><?php echo $form->input('DateOfPharmacist',array('type'=>'text','label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">IT compatibility</span></td>
<td>
<?php 
                      if(is_array($this->data['Locum']['ITCompatibility']))
                     {
                        $this->data['Locum']['ITCompatibility'] = implode(',',$this->data['Locum']['ITCompatibility']);
                     }
                    echo $form->select('ITCompatibility',$GLOBALS['ITCompatibility'],explode(',',$this->data['Locum']['ITCompatibility']),array('multiple'=>true,'label'=>'','div'=>''),false); ?>
<span class="noteOne">Ctrl + click to select multiple items</span>  
</td>          
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">EPS1 ready</span></td>
<td>Tick = Yes <?php echo $form->checkbox('EPS1Ready',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">EPS2 ready</span></td>
<td>Tick = Yes <?php echo $form->checkbox('EPS2Ready',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Essential services</span></td>
<td>
<?php 
                      if(is_array($this->data['Locum']['EssentialServices']))
                    {
                      $this->data['Locum']['EssentialServices'] = implode(',',$this->data['Locum']['EssentialServices']);
                    }
                    echo $form->select('EssentialServices',$GLOBALS['EssentialServices'],explode(',',$this->data['Locum']['EssentialServices']),array('label'=>'','div'=>'','multiple'=>true),false); ?>
 
<span class="noteOne">Ctrl + click to select multiple items</span>                
</td>          
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Advanced services</span></td>
<td>
<?php 
                     if(is_array($this->data['Locum']['AdvancedServices']))
                    {
                      $this->data['Locum']['AdvancedServices'] = implode(',',$this->data['Locum']['AdvancedServices']);
                    }
                    echo $form->select('AdvancedServices',$GLOBALS['AdvancedServices'],explode(',',$this->data['Locum']['AdvancedServices']),array('label'=>'','div'=>'','multiple'=>true),false); ?>
<span class="noteOne">Ctrl + click to select multiple items</span>
</td>          
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Enhanced services</span></td>
<td>
<?php 
                    if(is_array($this->data['Locum']['EnhancedServices']))
                    {
                      $this->data['Locum']['EnhancedServices'] = implode(',',$this->data['Locum']['EnhancedServices']);
                    }
                    echo $form->select('EnhancedServices',$GLOBALS['EnhancedServices'],explode(',',$this->data['Locum']['EnhancedServices']),array('label'=>'','div'=>'','multiple'=>true),false); ?>
<span class="noteOne">Ctrl + click to select multiple items</span>
</td>          
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Patient Group Directives</span></td>
<td>
<?php echo $form->textarea('PatientGroupDirectives',array('label'=>'','div'=>'','cols'=>30,'rows'=>5)); ?>
</td>
</tr>

<tr>
<td valign="top" width="200"><span class="frmLabel">Unavailable dates</span></td>
<td>
<div id="eventCalendarNoCache"></div>
<script>
$(document).ready(function() {
$("#eventCalendarNoCache").eventCalendar({
	eventsjson: '<?php echo Router::url('/').'locums/getJson/'.$id ?>',
	cacheJson: false,
	multiple: true,
});
});
</script>
<p>Calendar key</p>
<ul class="listTwo">
<li class="unavailable"> = Locum unavailable</li>
<li class="available"> = Locum available</li>
</ul>
<p>&nbsp;</p> 
</td>
</tr>

<tr>
<td><?php echo $form->submit();?></td>
<td>&nbsp;<?php echo $form->input('date',array('label'=>'','id'=>'event','type'=>'hidden','value'=>$a_Events['Event']['date'])); ?></td>
</tr>
</table>

<?php echo $form->end(); ?>
</div>
<!--COLUMN 2-->

<!--COLUMN 3-->
<div class="ThreeColGrid_c3">
<h6 class="TitleFive">Vacancy Search</h6>
<?php echo $this->element('search');?>
<?php echo $this->element('invite_locum');?> 
</div>
<!--COLUMN 3-->
